# GOAL: Erotic Adventure Novel + SJW Twitter Bot
# LANGUAGE: PYTHON 3

# Code of Conduct:
# GO HOME GAMER GURL
#
#Guys, will we actually hook the bot up to the Twitter API??
#Or will we only make it output text that seems like a tweet?
#lets go for text first. then hook it up.
#Ok m8.
#rip this idea
import os, pip, time, random, math
#What's the story?
#Character:
SJW_ADJECTIVES = [
    'racist',
    'sexist',
    'neo-sexist',#top fucking kek
    'neo-neo-nazi',#lel
    'heteronormative',
    'cisnormative',
    'white-washing',
    'fat-shaming',
    'slut-shaming',
    'sti-shaming',
    'feminist-insulting',
    'black-oppressing',
    'able-bodied',
    'white',
    'prideful',
    'nazi',
    'skinhead',
    'neo-nazi',
    'neo-racist', #lelwat
    'neo-fascist',
    'gender-shaming',
    'gender-normative',
    'rightist',
    'conservative',
    'thin-privileged',
    'thin-normative',
    'pomoromantic-identifying',
    'genderplatonic-associating',
    'overprivileged',
    'thin-elitist',
    'cis-elitist',
    'uterus-bearer-normative',
    'menlightening',
    'cisgender-supreme'
]

SJW_NOUNS = [
    'we dont have nouns lol', #lel
    'we dont have nouns lol',  #nigeria
]

SJW_VERBS = [
    'manspreading',
    'mansplaining',
    'manlightening',
]

SJW_HASHTAGS = [
    '#uterus-beareropinions',
    '#masculinitysofragile',
    '#gamergate',
    '#freezepeach',
    '#sexism',
    '#racismisnotfunny',
    '#feminism',
    '#notoracism',
    '#ISaluteBlackPeople',
    '#BlackLivesMatter',
    '#auspol', '#qanda', '#insight',
]

SJW_INSULTS = [
    'pissbaby',
    'shitlord',
    'breeder',
    'cis-scum',
    'cis-pig',
    'misogynist'
    'hater',
    'bootlicker',
    'misogynerd',#nigga how hard is it to put commas
    'python coder',
    'software designer',
    'GNU/Linux distribution coder',
    'tru-scum',
    'transmisogynist'
]

SJW_PHRASES = [
    'Trigger Warning!',
    'Wow. Just wow.',
    'I can\'t even.',
    'Holy fucking shit.',
    'What the fuck.',
    'TRIGGERED!'    
]
SJW_EMPHASIS = [
    'as fuck',
    'as shit',
    'as hell, we can\'t stand for this',
    '\b, smfh..',
    '\b. [enemy]'
]
SJW_ALLIES = [
    '@BarackObama',
    '@Bush',
    '@Benjikins',
    '@UN', #don't forget the united nations :^)
    '@Merchant' #greatest ally
]


import urllib, re
def get_blocked_list():
    url = 'https://blocktogether.org/show-blocks' +  '/5867111278318bd542293272f75147f8fc5931bea431e7ca16e9242964965d66494a6fb68f3518b82f171bcf0e419ccc?page={}'
    users = []
    for n in range(10): #Go through multiple pages
        c_url = url.format(n)
        socket = urllib.request.urlopen(c_url)
        html = socket.read().decode('utf-8')
        socket.close()
        
        #Find a screen name
        i = html.find("class='screen-name'")
        
        while i != -1:
            i = html.find("class='screen-name'")

            start = i + html[i:].find('>') + 1
            end = start + html[start:].find('</') - 1
            users.append(html[start:end].strip())
            html = html[end:]
        return users
    

SJW_ENEMIES = [ #we need a way to import the list from their blockbot YES.
    #oh fuck. the list is like 6 users long. it's that their bot finds the followers programatically, so we can't just curl it. shame. oh well.
    #wait here it is https://blocktogether.org/show-blocks/5867111278318bd542293272f75147f8fc5931bea431e7ca16e9242964965d66494a6fb68f3518b82f171bcf0e419ccc
    #gotta webscrape it tho
    '@nero',
    '@mistermetokur',
    '@rabite',
    '@LinusTorvalds', #topkek
]
SJW_ENEMIES.extend([x for x in map(lambda s: '@' + s, get_blocked_list())])

#i love how you can see how everyone types in real-time
#it's great.
#yes.
#this system has its flaws though, we can only make one type of text. for more universal texts we need something in front of the adjective, such as "as" to make comparisons with other things.

#One way to make it more sophisticated:
# WE have base 'types' - basically the ones we have now.
# But we can also have composed types.
# for instance, a similie is '[adjective] as [noun]'
#ah
#recursive templates, basically.
#true.

#I think i might have to rework inserts though...
#won't be quite as clean
#hmmm this is tough
#do we need an "a/an" detector for this..?

#i guess we can interact with the twitter API ourselvess.....
templates = [
    #'[phrase] This [insult] is [adjective] [emphasis]. [hashtag] [hashtag]',
    #'This [adjective] [insult] is the worst [adjective] [insult] ever! [hashtag] [hashtag]',
    '[enemy] This [adjective] [insult] is the worst [adjective] [insult] ever! [hashtag] [hashtag]'
]

inserts = {
    '[phrase]': SJW_PHRASES,
    '[insult]': SJW_INSULTS,
    '[noun]': SJW_NOUNS,
    '[adjective]': SJW_ADJECTIVES,
    '[emphasis]': SJW_EMPHASIS,
    '[hashtag]': SJW_HASHTAGS,
    '[ally]': SJW_ALLIES,
    '[enemy]': SJW_ENEMIES
}

def sjw_respond_mood_bad():
    t = templates[random.randint(0, len(templates)-1)]
    for type in inserts.keys():
        i = t.find(type)
        while(i != -1):
            dice = random.randint(0, len(inserts[type])-1)
            t = t[:i] + inserts[type][dice] + t[i+len(type):]
            i = t.find(type)
    print(t)


for i in range(min(50, int(input('number of tweets: ')))):
    sjw_respond_mood_bad()